'''
python文件 - 有道翻译
'''

# html = requests.post(url=post_url,data=data,headers=headers).text
# 解析：json.loads()

post_url = 'https://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'

headers = {
    '''Accept''': '''application/json, text/javascript, */*; q=0.01''',
    '''Accept-Encoding''': '''gzip, deflate, br''',
    '''Accept-Language''': '''zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,zh-TW;q=0.6''',
    '''Cache-Control''': '''no-cache''',
    '''Connection''': '''keep-alive''',
    '''Content-Length''': '''240''',
    '''Content-Type''': '''application/x-www-form-urlencoded; charset=UTF-8''',
    '''Cookie''': '''OUTFOX_SEARCH_USER_ID=-441685778@103.102.194.226; OUTFOX_SEARCH_USER_ID_NCOO=1311232133.5140777; _ntes_nnid=a6a6cfcf2f13779cd11ad8e2ca44836d,1595664981237; _ga=GA1.2.1866744817.1598613276; JSESSIONID=aaaeIHtcOn2cm55e3gfQx; SESSION_FROM_COOKIE=unknown; ___rl__test__cookies=1625734695963''',
    '''Host''': '''fanyi.youdao.com''',
    '''Origin''': '''https://fanyi.youdao.com''',
    '''Pragma''': '''no-cache''',
    '''Referer''': '''https://fanyi.youdao.com/''',
    '''sec-ch-ua''': '''"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"''',
    '''sec-ch-ua-mobile''': '''?0''',
    '''Sec-Fetch-Dest''': '''empty''',
    '''Sec-Fetch-Mode''': '''cors''',
    '''Sec-Fetch-Site''': '''same-origin''',
    '''User-Agent''': '''Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36''',
    '''X-Requested-With''': '''XMLHttpRequest''',
}

data = {
    "i": "monkey",
    "from": "AUTO",
    "to": "AUTO",
    "smartresult": "dict",
    "client": "fanyideskweb",
    "salt": "16257346959681",
    "sign": "dca99a8ac376dd522d67adac1d15b304",
    "lts": "1625734695968",
    "bv": "cda1e53e0c0eb8dd4002cefc117fa588",
    "doctype": "json",
    "version": "2.1",
    "keyfrom": "fanyi.web",
    "action": "FY_BY_REALTlME",
}





